home *** CD-ROM | disk | FTP | other *** search
Modula Definition | 1997-07-15 | 5.6 KB | 172 lines |
- DEFINITION MODULE dignet;
-
- (*$ Implementation- *)
-
- (*
- * dignet.library include
- *
- * Copyright © 1997 by Kenneth "Kenny" Nilsen/Digital Surface
- *
- * $VER: DIGNET_MOD 1.3 (14.7.97)
- *
- *)
-
- (*
- * Cyclone Modula-2 include by Ernest J Gainey III (wavy@cyberservices.com)
- *)
-
- IMPORT ED:ExecD;
- IMPORT DOSD:DosD;
- IMPORT S: SYSTEM;
-
- TYPE STRPTR=POINTER TO ARRAY [0..255] OF CHAR;
-
- (*
- * Error codes
- *)
-
- CONST DNETERROR_OK = 0; (* everything is ok *)
- CONST DNETERROR_OVERFLOW = -1; (* buffer overflow (your string buffer) *)
- CONST DNETERROR_WRONGNET = -2; (* you tried to free wrong net structure *)
- CONST DNETERROR_TIMEOUT = -3; (* timed out waiting to receivce chars *)
- CONST DNETERROR_POINTERERROR = -4; (* wrong pointer (null ptr.) *)
- CONST DNETERROR_OUTOFMEMORY = -5; (* not enough memory (Send/ReceiveNet()) *)
- CONST DNETERROR_FILEERROR = -6; (* file not found (Send/ReceiveNet()) *)
- CONST DNETERROR_PROTOCOL = -7; (* protocol error (not a protocol?) *)
- CONST DNETERROR_ABORTED = -8; (* protocol was aborted *)
- (*
- * IOEXT
- *)
-
- CONST DNIOEXT_SIZEOF = 80; (* max size for IOEXT structure *)
-
- (*
- * InitModem buffer size
- *)
-
- CONST INITMODEMBUFFER = 16; (* minimum length of initmodem's buffer *)
-
- (*
- * The public resource list structure
- *)
-
- TYPE DIGNETRT = RECORD
- DNRT_ID: LONGCARD; (* net ID *)
- DNRT_NET: S.ADDRESS; (* ptr. to netstructure *)
- DNRT_TASK: S.ADDRESS; (* ptr. to task structure using the net *)
- DNRT_TASKNAME: STRPTR; (* ptr. to task name of that task *)
- DNRT_DEVICENAME: STRPTR; (* ptr. to device name in use *)
- DNRT_UNIT: CARDINAL; (* unit number in use *)
- DNRT_SP: S.ADDRESS; (* Return address *)
- DNRT_MESSAGEPORT: S.ADDRESS; (* ptr. to message port of device *)
- DNRT_MESSAGESTRUCT: S.ADDRESS;(* ptr. to IO message of device *)
- DNRT_LASTCOMMAND: LONGCARD; (* command number on last librarycall *)
- DNRT_TASKSTATUS: INTEGER; (* BOOL on the tasks existance (true=ok) *)
- DNRT_reserved0: LONGCARD; (* reserved for future extensions *)
- DNRT_reserved1: LONGCARD;
- DNRT_reserved2: LONGCARD;
- DNRT_reserved3: LONGCARD;
- DNRT_reserved4: LONGCARD;
- END;
-
- CONST CMDALLOCNET = 1;
- CONST CMDREADNET = 2;
- CONST CMDWRITENET = 3;
- CONST CMDQUERYNET = 4;
- CONST CMDABORTNET = 5;
- CONST CMDINITIOEXT = 6;
- CONST CMDREADIOEXT = 7;
- CONST CMDSENDNET = 8;
- CONST CMDRECEIVENET = 9;
- CONST CMDTIMEOUT = 10;
- CONST CMDREADSTRING = 11;
- CONST CMDWRITESTRING = 12;
- CONST CMDGETNETPORT = 13;
- CONST CMDINITMODEM = 14;
- CONST CMDCALLMODEMDT = 15;
- CONST CMDCALLMODEMDP = 16;
- CONST CMDWAITMODEM = 17;
- CONST CMDHANGUPMODEM = 18;
- CONST CMDSTOPWAITING = 19;
- CONST CMDFLUSHNET = 20;
- CONST CMDSETBAUD = 21;
- CONST CMDCONVERTMODEMSTRING = 22;
- CONST CMDGETIOMSG = 23;
- CONST CMDGETMODEMSTATUS = 24;
- CONST CMDGETCURRENTDEVICE = 25;
- CONST CMDGETCURRENTUNIT = 26;
- CONST CMDGETBAUDRATE = 27;
- CONST CMDPARSECONNECT = 28;
- CONST CMDSETDEFAULT = 29;
- CONST CMDCONVERTTOPC = 30;
- CONST CMDCONVERTTOAMIGA = 31;
- CONST CMDFREECONVERT = 32;
- CONST CMDOBTAINNET = 33;
-
- (* new from v4 *)
-
- CONST CMDWAITTEXT = 34;
- CONST CMDCONVERSETEXT = 35;
- CONST CMDCAPTURETEXTSTART = 36;
- CONST CMDCAPTURETEXTEND = 37;
- CONST CMDSETPARITY = 38;
- CONST CMDSETHANDSHAKE = 39;
- CONST CMDSETSTOPBITS = 40;
- CONST CMDSETBITWIDTH = 41;
- CONST CMDGETPARITY = 42;
- CONST CMDGETHANDSHAKE = 43;
- CONST CMDGETSTOPBITS = 44;
- CONST CMDGETBITWIDTH = 45;
-
- (*
- * New from 3.1
- * Update structure for the Dignet protocol
- *)
-
- TYPE DIGNETUPDATE = RECORD
- DNU_FILENAME : ARRAY [0..107] OF CHAR; (* name of file without path *)
- DNU_FILESIZE : LONGCARD; (* size of file in bytes *)
- DNU_RATE : LONGCARD; (* transfer rate bytes/s *)
- DNU_EXPECTED : DOSD.Date; (* expected time on transfer *)
- DNU_USED : DOSD.Date; (* time used on transfer *)
- DNU_STATUS : CARDINAL; (* status flags *)
- DNU_HOOK : LONGINT; (* hook to be called after each
- block transfer *)
- END;
-
- CONST DNUSTATUS_OK = 0; (* everthing is ok *)
- CONST DNUSTATUS_ERROR = 1; (* transfer had an error *)
- CONST DNUSTATUS_RESENDING = 2; (* resending block/file *)
- CONST DNUSTATUS_WAITING = 4; (* waiting to receive/send file *)
- CONST DNUSTATUS_ABORT = 8; (* was aborted, if you set this flag
- protocol will be aborted *)
- CONST DNUSTATUS_END = 16; (* end of file (done) *)
-
- (*
- To let user abort a protocol transfer you need to create a subtask that will
- check for user input such as keypress/mousebutton/gadget etc. If user want to
- abort transfer you must set the _abort flag. The other end of the protocol
- will read this as user abort and end. If not this flag can be interacted the
- protocol will not stop until the whole file is transfered/resent error free.
- *)
-
- (* CaptureTextStart modes: *)
-
- CONST DNCAPTURENEW = 0;
- CONST DNCAPTUREAPPEND = -1;
-
- (* Modes for SetParity *)
-
- CONST DNPARITYNONE = 0;
- CONST DNPARITYEVEN = 1;
- CONST DNPARITYODD = 2;
- CONST DNPARITYMARK = 3;
- CONST DNPARITYSPACE = 4;
-
- (* MODES FOR SETHANDSHAKE *)
-
- CONST DNHANDSHAKENONE = 0;
- CONST DNHANDSHAKE7WIRE = 1; (* RTS/CTS *)
- CONST DNHANDSHAKEX = 2; (* XON/XOFF *)
-
- END dignet.